package com.boot.system.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.boot.framework.constants.PageConstants;
import com.boot.framework.utils.Condition;
import com.boot.system.dto.SysFileDTO;
import com.boot.system.entity.SysFileEntity;
import com.boot.system.mapper.SysFileMapper;
import com.boot.system.wrapper.SysFileWrapper;
import com.boot.system.service.ISysFileService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 文件管理表
 *
 * @author pig
 * @date 2024-02-01 20:58:58
 */
@Service
public class SysFileServiceImpl extends ServiceImpl<SysFileMapper, SysFileEntity> implements ISysFileService {
    private LambdaQueryWrapper<SysFileEntity> getQueryWrapper(Map<String, Object> params) {

        return Wrappers.lambdaQuery(SysFileEntity.class);
    }

    @Override
    public IPage<SysFileDTO> selectPage(Map<String, Object> params) {
        return SysFileWrapper.build().pageDTO(baseMapper.selectPage(Condition.getPage(params), getQueryWrapper(params)));
    }

    @Override
    public List<SysFileDTO> selectList(Map<String, Object> params) {
        return SysFileWrapper.build().listDTO(baseMapper.selectList(getQueryWrapper(params)));
    }
}